﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPageMcSigAdmin.master" AutoEventWireup="true"
    CodeFile="OrdenCargue.aspx.cs" Inherits="OrdenCargue" %>

<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxLoadingPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxCallbackPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="UsrControls" Namespace="UsrControls" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript" languaje="javascript">
    function ejecutarPostback() {
        alert("llamo el postback");
        __doPostBack('btnRemesas', '');
}

function cargarRemesas() {
    //alert("si funciona");
    //__doPostBack('btnRemesas', '');
}

</script>

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <h1 class="presupuesto">
        Orden de Cargue</h1>
    <table border="0" cellpadding="0" cellspacing="0" width="960px">
        <tr>
            <td class="instruccion">
                Para agregar o actualizar la información de una orden de pago, por favor complete
                los datos en el formulario y a continuación pulse sobre el botón GRABAR.
            </td>
        </tr>
        <tr>
            <td align="left">
                <asp:ImageButton ID="btnRegresar" runat="server" ImageUrl="~/Images/bt-regresar.gif"
                    OnClick="btnRegresar_Click" CausesValidation="False" />
            </td>
        </tr>
        <tr>
            <td align="left">
                <dx:ASPxLabel runat="server" ID="lblNumeroOrdenCargue" Text="0">
                </dx:ASPxLabel>
                <asp:Label runat="server" ID="lblMensajeAsignarVines"></asp:Label>
                <asp:Label runat="server" ID="lblMensajeLiberarVines"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" Width="100%"
                    ForeColor="Black">
                    <asp:TabPanel runat="server" HeaderText="ORDEN DE CARGUE" ID="TabPanel1">
                        <HeaderTemplate><b>ORDEN DE CARGUE</b></HeaderTemplate>
                        <ContentTemplate><table style="width: 100%;" border="0"  cellspacing="0"><tr><td colspan="2"><dx:ASPxCallback ID="ASPxCallback1" runat="server" ClientIDMode="AutoID" ClientInstanceName="Callback"><ClientSideEvents CallbackComplete="function(s, e) { LoadingPanel.Hide(); }" /></dx:ASPxCallback><dx:ASPxLoadingPanel ID="LoadingPanel" runat="server" ClientIDMode="AutoID" ClientInstanceName="LoadingPanel"
                                            CssPostfix="SoftOrange" ImagePosition="Top" Modal="True" Theme="iOS"><Image Url="~/App_Themes/SoftOrange/Web/Loading.gif"></Image></dx:ASPxLoadingPanel><cc1:msgBox ID="msgBox1" runat="server" /><asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
                                            ShowSummary="False" /></td></tr><tr><td class="campo" style="width: 25%">NUMERO ORDEN DE CARGUE </td><td>&nbsp;&nbsp; </td></tr><tr><td class="campo-obligatorio">CABEZOTE </td><td><dx:ASPxComboBox ID="ddlCabezote" runat="server" Theme="PlasticBlue" IncrementalFilteringMode="Contains"
                                            AutoResizeWithContainer="True" AutoPostBack="True" 
                                            onselectedindexchanged="ddlCabezote_SelectedIndexChanged"></dx:ASPxComboBox><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlCabezote"
                                            ErrorMessage="El campo Cabezote es obligatorio">*</asp:RequiredFieldValidator></td></tr><tr><td class="campo-obligatorio">TRAILER </td><td><dx:ASPxComboBox ID="ddlTrailer" runat="server" Theme="PlasticBlue" IncrementalFilteringMode="Contains"
                                            AutoResizeWithContainer="True"></dx:ASPxComboBox><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ddlTrailer"
                                            ErrorMessage="El campo Trailer es obligatorio">*</asp:RequiredFieldValidator></td></tr><tr><td class="campo-obligatorio">ESTADO ORDEN </td><td><table style="width: 100%;"><tr><td><dx:ASPxComboBox ID="ddlEstadosOrden" runat="server" AutoResizeWithContainer="True"
                                                            IncrementalFilteringMode="Contains" Theme="PlasticBlue"></dx:ASPxComboBox></td><td><dx:ASPxButton ID="btnEnviarCoordendas" runat="server" Text="Enviar cargue  GM" 
                                                            OnClick="btnEnviarCoordendas_Click" Visible="False"></dx:ASPxButton></td></tr></table><asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ControlToValidate="ddlEstadosOrden"
                                                ErrorMessage="El campo estado orden es obligatorio">*</asp:RequiredFieldValidator></td><tr><td class="campo-obligatorio">CONDUCTOR </td><td><dx:ASPxComboBox ID="ddlConductores" runat="server" AutoResizeWithContainer="True"
                                                    HorizontalAlign="Left" IncrementalFilteringMode="Contains" Theme="PlasticBlue"
                                                    Width="50%"></dx:ASPxComboBox><asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="ddlConductores"
                                                    ErrorMessage=" El campo Conductor es obligatorio">*</asp:RequiredFieldValidator></td></tr></tr><tr><td class="campo-obligatorio">FECHA DE SOLICITUD </td><td style="height: 39px;"><asp:TextBox ID="txtFechaSolicitud" runat="server" ></asp:TextBox><asp:CalendarExtender
                                                ID="txtFechaSolicitud_CalendarExtender" runat="server" Enabled="True" Format="MM/dd/yyyy"
                                                TargetControlID="txtFechaSolicitud"></asp:CalendarExtender><asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtFechaSolicitud"
                                                ErrorMessage="El campo fecha de solicitud es obligatorio">*</asp:RequiredFieldValidator></td></tr><tr><td class="campo-obligatorio">FECHA DE CARGUE </td><td style="height: 39px;"><asp:TextBox ID="txtFechaAsignacion" runat="server"></asp:TextBox><asp:CalendarExtender
                                                ID="txtFechaAsignacion_CalendarExtender" runat="server" Enabled="True" Format="MM/dd/yyyy"
                                                TargetControlID="txtFechaAsignacion" ></asp:CalendarExtender><asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ControlToValidate="txtFechaAsignacion"
                                                ErrorMessage="El campo fecha de asignación es obligatorio">*</asp:RequiredFieldValidator></td></tr><tr><td class="campo-obligatorio">FECHA DE ENTREGA </td><td style="height: 39px"><asp:TextBox ID="txtFechaEntrega" runat="server"></asp:TextBox><asp:CalendarExtender
                                                ID="txtFechaEntrega_CalendarExtender" runat="server" Enabled="True" Format="MM/dd/yyyy"
                                                TargetControlID="txtFechaEntrega" PopupPosition="TopLeft"></asp:CalendarExtender><asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtFechaEntrega"
                                                ErrorMessage="EL campo fecha de entrega es obligatorio">*</asp:RequiredFieldValidator></td></tr><tr><td colspan="2" align="center"><dx:ASPxButton ID="btnGrabar" runat="server" ClientIDMode="AutoID" Height="27px"
                                                OnClick="btnGrabar_Click" Text="GRABAR" Theme="PlasticBlue" Width="148px"><ClientSideEvents Click="function(s, e) { Callback.PerformCallback();  LoadingPanel.Show(); }" /></dx:ASPxButton></td></tr></tr></tr></table></ContentTemplate>
                    </asp:TabPanel>
                    <asp:TabPanel runat="server" HeaderText="TabPanel2" ID="TabPanel2">
                        <HeaderTemplate><b>VINES DISPONIBLES</b></HeaderTemplate>
                        <ContentTemplate><table width="960px"><tr><td colspan="2">&nbsp;<asp:CheckBox ID="CheckBoxMostrarTodosVines" runat="server" 
                                            AutoPostBack="True" oncheckedchanged="CheckBoxMostrarTodosVines_CheckedChanged" 
                                            Text="Mostrar Todos los Vines" /></td></tr><tr><td colspan="2"><dx:ASPxGridView ID="ASPxGridViewVines" runat="server" AutoGenerateColumns="False"
                                            KeyFieldName="AVI_ID" Theme="PlasticBlue" ClientInstanceName="ASPxGridViewVines"><Columns><dx:GridViewCommandColumn VisibleIndex="0" ShowSelectCheckbox="True" 
                                                    ShowInCustomizationForm="True"></dx:GridViewCommandColumn><dx:GridViewDataTextColumn FieldName="AVI_ID" ReadOnly="True" VisibleIndex="1" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_CLIENTE" VisibleIndex="2" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_ORIGEN" VisibleIndex="3" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_DESTINO" VisibleIndex="4" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_CONCESIONARIO" VisibleIndex="5" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_VIN" VisibleIndex="6" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_NoMOTOR" VisibleIndex="7" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_INVENTARIO" VisibleIndex="8" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_DESCRIPCION" VisibleIndex="9" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_COLOR" VisibleIndex="10" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_ZONA" VisibleIndex="11" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_SOLICITANTE" VisibleIndex="12" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_ALMACEN" VisibleIndex="13" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_TIPO_FACTURACION" VisibleIndex="14" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_NoEQUIPO" VisibleIndex="15" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_ZVSK" VisibleIndex="16" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_KMAT" VisibleIndex="17" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_TIPO" VisibleIndex="18" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_TIPO_UNIDAD" VisibleIndex="19" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_ANO_MDL" VisibleIndex="20" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_PEDIDO" VisibleIndex="21" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_ENTREGA" VisibleIndex="22" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_FACTURA" VisibleIndex="23" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_FCH_FACT" VisibleIndex="24" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_BL" VisibleIndex="25" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_FECHA_DESPACHO_DEALER" 
                                                    VisibleIndex="26" ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_DESPACHO" VisibleIndex="27" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_FECHA_RECEPCION_DEALER" 
                                                    VisibleIndex="28" ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_NOVEDADES_DESTINO" VisibleIndex="29" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_NOVEDADES_ORIGEN" VisibleIndex="30" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_REPORTE_FACTURA" VisibleIndex="31" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_COMENTARIOS" VisibleIndex="32" 
                                                    ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_REPORTADO_EN_DESPACHO" 
                                                    VisibleIndex="33" ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_REPORTADO_EN_ENTREGA" 
                                                    VisibleIndex="34" ShowInCustomizationForm="True"></dx:GridViewDataTextColumn></Columns><Settings ShowFilterRow="True" ShowGroupPanel="True" ShowFilterRowMenu="True" /></dx:ASPxGridView></td></tr><tr><td width="15%">I</td><td>&nbsp;<asp:FileUpload ID="fuImportar" runat="server" Visible="False" /><dx:ASPxButton ID="btnImportarVines"
                                            runat="server" ClientIDMode="AutoID" Height="27px" OnClick="btnImportarVines_Click"
                                            Text="Importar" Theme="PlasticBlue" Width="148px" Visible="False"><ClientSideEvents Click="function(s, e) { Callback.PerformCallback();  LoadingPanel.Show(); }" /></dx:ASPxButton><asp:HyperLink ID="HyperLink1" runat="server" ClientIDMode="Static" 
                                            NavigateUrl="~/Archivos/PruebaAutosol.xls" Visible="False">Descargar Plantilla</asp:HyperLink></td></tr><tr><td colspan="2"><dx:ASPxButton ID="btnAsociarVines0" runat="server" ClientIDMode="AutoID" Height="27px"
                                            OnClick="btnAsociarVines_Click" Text="GUARDAR" Theme="PlasticBlue" Width="148px"></dx:ASPxButton></td></tr></table></ContentTemplate>
                    </asp:TabPanel>
                    <asp:TabPanel runat="server" HeaderText="TabPanel3" ID="TabPanel3">
                        <HeaderTemplate><b>VINES ASIGNADOS</b></HeaderTemplate>
                        <ContentTemplate><table><tr><td><dx:ASPxGridView ID="ASPxGridViewVinesAsociados" runat="server" AutoGenerateColumns="False"
                                            KeyFieldName="AVI_ID" Theme="PlasticBlue" Width="950px" ClientInstanceName="ASPxGridViewVinesAsociados"
                                            OnCustomCallback="ASPxGridViewVinesAsociados_CustomCallback" 
                                            OnRowUpdating="ASPxGridViewVinesAsociados_RowUpdating" 
                                            onrowvalidating="ASPxGridViewVinesAsociados_RowValidating"><Columns><dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0" 
                                                    ShowInCustomizationForm="True"><EditButton Visible="True"></EditButton></dx:GridViewCommandColumn><dx:GridViewDataTextColumn FieldName="AVI_ID" ReadOnly="True" VisibleIndex="1" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_CLIENTE" VisibleIndex="2" 
                                                    Caption="CLIENTE" ReadOnly="True" ShowInCustomizationForm="True"><PropertiesTextEdit><ReadOnlyStyle BackColor="#66FFCC"></ReadOnlyStyle></PropertiesTextEdit></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_ORIGEN" VisibleIndex="3" 
                                                    Caption="ORIGEN" ReadOnly=True ShowInCustomizationForm="True"><PropertiesTextEdit><ReadOnlyStyle BackColor="#66FFCC"></ReadOnlyStyle></PropertiesTextEdit></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_REPORTADO_EN_DESPACHO" 
                                                    VisibleIndex="9" ShowInCustomizationForm="True"><EditCellStyle BackColor="#0099CC"></EditCellStyle><CellStyle BackColor="#0099CC"></CellStyle></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_DESTINO" Caption="CUIDAD DESTINO" 
                                                    VisibleIndex="4" ReadOnly=True Width=250px ShowInCustomizationForm="True"><PropertiesTextEdit><ReadOnlyStyle BackColor="#66FFCC"></ReadOnlyStyle></PropertiesTextEdit></dx:GridViewDataTextColumn><dx:GridViewDataComboBoxColumn Caption="ORIGEN" FieldName="ACL_ID_ORIGEN" 
                                                    VisibleIndex="5" ShowInCustomizationForm="True"><PropertiesComboBox DataSourceID="SqlDataSourceClienteOrigen" TextField="Nombre"
                                                        IncrementalFilteringMode="StartsWith" ValueField="ACL_ID_ORIGEN"></PropertiesComboBox><EditCellStyle BackColor="#0099CC"></EditCellStyle><CellStyle BackColor="#0099CC"></CellStyle></dx:GridViewDataComboBoxColumn><dx:GridViewDataComboBoxColumn Caption="DESTINO" FieldName="ACL_ID_DESTINO" 
                                                    VisibleIndex="6" ShowInCustomizationForm="True"><PropertiesComboBox DataSourceID="SqlDataSourceClienteDestino" TextField="Nombre"
                                                         IncrementalFilteringMode="StartsWith" ValueField="ACL_ID_DESTINO"></PropertiesComboBox><EditCellStyle BackColor="#0099CC"></EditCellStyle><CellStyle BackColor="#0099CC"></CellStyle></dx:GridViewDataComboBoxColumn><dx:GridViewDataTextColumn FieldName="AVI_CONCESIONARIO" VisibleIndex="4" 
                                                    Caption="CONCESIONARIO DESTINO"  ReadOnly=True 
                                                    ShowInCustomizationForm="True"><PropertiesTextEdit><ReadOnlyStyle BackColor="#66FFCC"></ReadOnlyStyle></PropertiesTextEdit></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_REPORTADO_EN_ENTREGA" 
                                                    VisibleIndex="10" ShowInCustomizationForm="True"><EditCellStyle BackColor="#0099CC"></EditCellStyle><CellStyle BackColor="#0099CC"></CellStyle></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_VIN" VisibleIndex="12" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_INVENTARIO" VisibleIndex="13" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_DESCRIPCION" VisibleIndex="14" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_COLOR" VisibleIndex="15" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_ZONA" VisibleIndex="16" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_SOLICITANTE" VisibleIndex="17" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_ALMACEN" VisibleIndex="18" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_TIPO_FACTURACION" VisibleIndex="19" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_NoEQUIPO" VisibleIndex="20" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_ZVSK" VisibleIndex="21" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_KMAT" VisibleIndex="22" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_TIPO" VisibleIndex="23" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_TIPO_UNIDAD" VisibleIndex="24" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_ANO_MDL" VisibleIndex="25" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_PEDIDO" VisibleIndex="26" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_ENTREGA" VisibleIndex="27" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_FACTURA" VisibleIndex="28" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_FCH_FACT" VisibleIndex="29" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_BL" VisibleIndex="30" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_FECHA_DESPACHO_DEALER" 
                                                    VisibleIndex="31" ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_DESPACHO" VisibleIndex="11" 
                                                    ShowInCustomizationForm="True"><EditCellStyle BackColor="#0099CC"></EditCellStyle><CellStyle BackColor="#0099CC"></CellStyle></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_FECHA_RECEPCION_DEALER" 
                                                    VisibleIndex="32" ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataMemoColumn FieldName="AVI_NOVEDADES_DESTINO" VisibleIndex="8" 
                                                    ShowInCustomizationForm="True"><PropertiesMemoEdit Height="100px"></PropertiesMemoEdit><EditCellStyle BackColor="#0099CC"></EditCellStyle><CellStyle BackColor="#0099CC"></CellStyle></dx:GridViewDataMemoColumn><dx:GridViewDataMemoColumn FieldName="AVI_NOVEDADES_ORIGEN" VisibleIndex="7" 
                                                    ShowInCustomizationForm="True"><PropertiesMemoEdit Height="100px"></PropertiesMemoEdit><EditCellStyle BackColor="#0099CC"></EditCellStyle><CellStyle BackColor="#0099CC"></CellStyle></dx:GridViewDataMemoColumn><dx:GridViewDataTextColumn FieldName="AVI_REPORTE_FACTURA" VisibleIndex="33" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_COMENTARIOS" VisibleIndex="34" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn FieldName="AVI_NoMOTOR" VisibleIndex="35" 
                                                    ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn></Columns><SettingsEditing Mode="PopupEditForm" /><Settings ShowFilterRow="True" ShowGroupPanel="True" ShowTitlePanel="True" 
                                                ShowFilterRowMenu="True" /><SettingsText Title="VINES ASOCIADOS" /><SettingsPopup><EditForm AllowResize="True" Width="800px" /></SettingsPopup></dx:ASPxGridView></td></tr><tr><td><dx:ASPxButton ID="btnLiberarVines" runat="server" ClientIDMode="AutoID" Height="27px"
                                            Text="LIBERAR VINES" Theme="PlasticBlue" Width="148px" OnClick="btnLiberarVines_Click"></dx:ASPxButton><asp:SqlDataSource ID="SqlDataSourceClienteDestino" runat="server" ConnectionString="<%$ ConnectionStrings:MCSIGConnectionString %>"
                                            SelectCommand="SELECT        AUT_CLIENTES.ACL_ID AS ACL_ID_DESTINO, 
BAS_ZONAS_GEOGRAFICAS.ZON_NOMBRE AS Municipio, 
BAS_ZONAS_GEOGRAFICAS_1.ZON_NOMBRE AS Departamento,
AUT_CLIENT.ACT_NOMBRE + ' ' + BAS_ZONAS_GEOGRAFICAS.ZON_NOMBRE + ' ' + AUT_CLIENTES.ACL_RAZON_SOCIAL AS Nombre
FROM            AUT_CLIENTES INNER JOIN
                         BAS_ZONAS_GEOGRAFICAS ON AUT_CLIENTES.ZON_ID = BAS_ZONAS_GEOGRAFICAS.ZON_ID INNER JOIN
                         BAS_ZONAS_GEOGRAFICAS AS BAS_ZONAS_GEOGRAFICAS_1 ON 
                         BAS_ZONAS_GEOGRAFICAS.ZON_PADRE_ID = BAS_ZONAS_GEOGRAFICAS_1.ZON_ID INNER JOIN
                         AUT_CLIENT ON AUT_CLIENTES.ACT_ID = AUT_CLIENT.ACT_ID"></asp:SqlDataSource><asp:SqlDataSource ID="SqlDataSourceClienteOrigen" runat="server" ConnectionString="<%$ ConnectionStrings:MCSIGConnectionString %>"
                                            SelectCommand="SELECT dbo.AUT_CLIENTES.ACL_ID AS ACL_ID_ORIGEN, 
dbo.BAS_ZONAS_GEOGRAFICAS.ZON_NOMBRE AS Municipio, 
BAS_ZONAS_GEOGRAFICAS_1.ZON_NOMBRE AS Departamento,  
AUT_CLIENT.ACT_NOMBRE + ' ' + dbo.BAS_ZONAS_GEOGRAFICAS.ZON_NOMBRE+ ' ' + dbo.AUT_CLIENTES.ACL_RAZON_SOCIAL AS Nombre 

FROM            AUT_CLIENTES INNER JOIN
                         BAS_ZONAS_GEOGRAFICAS ON AUT_CLIENTES.ZON_ID = BAS_ZONAS_GEOGRAFICAS.ZON_ID INNER JOIN
                         BAS_ZONAS_GEOGRAFICAS AS BAS_ZONAS_GEOGRAFICAS_1 ON 
                         BAS_ZONAS_GEOGRAFICAS.ZON_PADRE_ID = BAS_ZONAS_GEOGRAFICAS_1.ZON_ID INNER JOIN
                         AUT_CLIENT ON AUT_CLIENTES.ACT_ID = AUT_CLIENT.ACT_ID"></asp:SqlDataSource></td></tr></table></ContentTemplate>
                    </asp:TabPanel>
                    <asp:TabPanel ID="TabPanel4" runat="server" HeaderText="TabPanel4" OnClientClick="cargarRemesas">
                        <HeaderTemplate><b>REMESAS</b></HeaderTemplate>
                        <ContentTemplate><b><asp:Button ID="btnRemesas" runat="server" OnClick="btnRemesas_Click" 
                                Text="Mostrar Remesas" /></b><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><dx:ASPxGridView ID="ASPxGridRemesas" runat="server" AutoGenerateColumns="False"
                                ClientInstanceName="ASPxGridViewVinesAsociados" KeyFieldName="ACL_ID" Theme="PlasticBlue"
                                Width="950px" OnRowCommand="ASPxGridRemesas_RowCommand"><Columns><dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0" 
                                        ShowInCustomizationForm="True"></dx:GridViewCommandColumn><dx:GridViewDataTextColumn Caption="CLIENTE" FieldName="ACL_RAZON_SOCIAL" 
                                        VisibleIndex="2" ShowInCustomizationForm="True"></dx:GridViewDataTextColumn><dx:GridViewDataTextColumn Caption="ID" FieldName="ACL_ID" ReadOnly="True" 
                                        VisibleIndex="1" ShowInCustomizationForm="True"><EditFormSettings Visible="False" /></dx:GridViewDataTextColumn><dx:GridViewDataHyperLinkColumn Caption="NUMERO REMESA" VisibleIndex="3" 
                                        ShowInCustomizationForm="True"><DataItemTemplate><table><tr><td>
                                        
                                        <asp:LinkButton CommandName="cmdGenerar" Visible='<%# Convert.ToDecimal(Eval("AVI_NUMERO_REMESA")) == 0 ? true :  false%>' ID="LinkButton1" runat="server">Generar Número Remesa</asp:LinkButton>
<asp:Label ID="lblNumeroRemesa" runat=server Text='<%# Eval("AVI_NUMERO_REMESA")%>' /></td></tr>

<tr><td><asp:LinkButton CommandName="cmdEnviarCargue"  ID="LinkButton2" runat="server">Enviar Cargue GM</asp:LinkButton>Numero Transaccion </td></tr>
<tr><td><asp:LinkButton CommandName="cmdEstadoRemesa"  ID="LinkButton3" runat="server">Estado : </asp:LinkButton>
<asp:Label ID="Label1" runat=server Text='<%# Eval("AES_NOMBRE")%>' />

</td></tr>


<tr><td><asp:LinkButton CommandName="cmdFactura"  
ID="LinkButton4" runat="server">Factura : </asp:LinkButton></td></tr></table></DataItemTemplate></dx:GridViewDataHyperLinkColumn></Columns><SettingsEditing Mode="PopupEditForm" /><Settings ShowFilterRow="True" ShowGroupPanel="True" ShowTitlePanel="True" /><SettingsText Title="VINES ASOCIADOS" /><SettingsPopup><EditForm AllowResize="True" Width="800px" /></SettingsPopup></dx:ASPxGridView><cc1:PopupPanel ID="PopupPanelEstado" runat="server" Height="200px"><table style="width:100%;"><tr><td>&#160;</td><td>&#160;</td></tr><tr><td>&#160;</td><td align="left"><asp:ImageButton ID="btnCerrarPopupEstado" runat="server" 
                                                ImageUrl="~/Imagenes/fancy_close.png" onclick="btnCerrarPopupEstado_Click" /></td></tr><tr><td>ESTADO</td><td>
                                                <dx:ASPxComboBox ID="ddlEstadoRemesa" runat="server" Theme="PlasticBlue" IncrementalFilteringMode="Contains"
                                            AutoResizeWithContainer="True"></dx:ASPxComboBox>
                                            
                                            </td></tr><tr><td colspan="2" align="center"><asp:Button ID="btnGuardarEstado" runat="server" Text="Guardar" 
                                                onclick="btnGuardarEstado_Click" /></td></tr></table></cc1:PopupPanel><cc1:PopupPanel ID="PopupPanelFacturacion" runat="server" Height="200px"><table style="width:100%;"><tr><td>&#160;</td><td align="left"><asp:ImageButton ID="ImageButton1" runat="server" 
                                                ImageUrl="~/Imagenes/fancy_close.png" onclick="ImageButton1_Click"  /></td></tr><tr><td>NUMERO DE FACTURA</td><td><asp:TextBox ID="txtNumeroFactura" runat="server" Width="247px"></asp:TextBox></td></tr><tr><td colspan="2" align="center"><asp:Button ID="btnGuardarNumeroFactura" runat="server" Text="Guardar" onclick="btnGuardarNumeroFactura_Click" 
                                                 /></td></tr></table></cc1:PopupPanel></ContentTemplate></asp:UpdatePanel><asp:SqlDataSource ID="SqlDataSourceRemesas" runat="server" ConnectionString="<%$ ConnectionStrings:MCSIGConnectionString %>"
                                SelectCommand="SELECT DISTINCT dbo.AUT_CLIENTES.ACL_RAZON_SOCIAL, dbo.AUT_CLIENTES.ACL_ID,dbo.AUT_VINES.AVI_NUMERO_REMESA
 FROM dbo.AUT_ORDEN_SALIDA INNER JOIN dbo.AUT_ORDEN_SALIDA_AUT_VIN ON dbo.AUT_ORDEN_SALIDA.AOS_ID = dbo.AUT_ORDEN_SALIDA_AUT_VIN.AOS_ID INNER JOIN dbo.AUT_VINES 
 ON dbo.AUT_ORDEN_SALIDA_AUT_VIN.AVI_ID = dbo.AUT_VINES.AVI_ID INNER JOIN dbo.AUT_CLIENTES ON dbo.AUT_VINES.ACL_ID_DESTINO = dbo.AUT_CLIENTES.ACL_ID WHERE (dbo.AUT_ORDEN_SALIDA.AOS_ID = @AOS_ID)"><SelectParameters><asp:ControlParameter ControlID="lblNumeroOrdenCargue" Name="AOS_ID" PropertyName="Text"
                                        Type="Decimal" /></SelectParameters></asp:SqlDataSource><dx:ASPxButton ID="btnImprimirRemesa" runat="server" ClientIDMode="AutoID" Height="27px"
                                Text="IMPRIMIR REMESA" Theme="PlasticBlue" Width="148px" OnClick="btnImprimirRemesa_Click"></dx:ASPxButton></ContentTemplate>
                    </asp:TabPanel>
                </asp:TabContainer>
            </td>
        </tr>
    </table>
</asp:Content>
